import 'package:flutter/material.dart';

import '../../components/mydialog.dart';

class HomePage extends StatefulWidget {
  HomePage({Key key}) : super(key: key);

  _HomePageState createState() => _HomePageState();
}

class _HomePageState extends State<HomePage> {
  @override
  Widget build(BuildContext context) {
    return Center(
      child: Column(
        mainAxisAlignment: MainAxisAlignment.center,
        children: <Widget>[
          RaisedButton(
            child: Text('跳转到轮播图'),
            onPressed: (){
              Navigator.pushNamed(context, '/swiper');
            }
          ),
          RaisedButton(
            child: Text('跳转到Dialog'),
            onPressed: (){
              Navigator.pushNamed(context, '/dialog');
            }
          ),
          RaisedButton(
            child: Text('显示自定义 Dialog'),
            onPressed: (){
              showDialog(
                context: context,
                builder: (context) {
                  return MyDialog(title:'关于我们', content:'内容');
                }
              );
            }
          )
        ], 
      )
    );
  }
}
